<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class pratice extends Controller
{

    protected $arr = [0,1,2,3,4,5,6,7,8,9];

    //
    public function  test() {
        $k = 0;
        $n = 0;
        $condition = true;
        $start_time = time();
        $a = [];
        while ($condition) {
            if ($k > 9) {
                $k = 0;
            }
            $a[] = $this->arr[$k];
            $k++;
            $n++;
            if ($n == 3) {
                $this->deal($a);
                if (time() - $start_time < 60) {
                    sleep(100);
                    $k = 0;
                    $n = 0;
                    $a = [];
                } else {
                    $condition = false;
                }
            }
        }

    }

    public function deal($arr){
        dump($arr);
    }
}
